package com.chixing.day16.IODemo;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;

public class ReaderDemo {
    public static void main(String[] args) {
        Reader red = null;
        try {
            red = new FileReader("//Users//jasonmarslyon//CX_Workspace//Java_Workspace//Test//test.txt");
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }

        char[] bt = new char[1024];
        int len = 0;
        int temp;
        try {
            while ((temp = red.read()) != -1) {
                bt[len++] = (char) temp;
            }
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            if (red != null) {
                try {
                    red.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
        System.out.println(new String(bt));


    }
}
